#include<stdio.h>
#include<stdlib.h>
#include "dominion.h"

void setUpGame(struct gameState *gs){

	int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse,
	           sea_hag, tribute, smithy};

	initializeGame(2, k, 1, gs);
	int player=0;

	gs->handCount[player]=5;

	int handpos=0;

	gs->hand[player][handpos] = steward;
	gs->hand[player][1] = estate;
	gs->hand[player][2] = duchy;
	gs->hand[player][3] = province;
	gs->hand[player][4] = great_hall; //total 10
	
	}

void testcardIsSteward(){

	struct gameState *gs;
	
	
	// Test 1: Cards in hand increase by 2
	gs=newGame();
	setUpGame(gs);

	int choice1=3;
	int choice2=0;
	int choice3=0;
	int handpos=0;
	int player=0;

	zzzstewardcardplay(player, choice1, choice2, choice3, gs, handpos) ;

	if(gs->handCount[player]==6)
	{
		printf("zzzstewardcardplay(): PASS when player chooses to draw +2 cards\n");
	}
	else{

		printf("zzzstewardcardplay(): FAIL  when player chooses to draw +2 cards\n");
	}
	
	
	//Test 2: Player chooses  +2 coins
	gs=newGame();

	setUpGame(gs);

	 choice1=0;
	 choice2=0;
	 choice3=2;
	int coinsbefore=gs->coins;
	
	zzzstewardcardplay(player, choice1, choice2, choice3, gs, handpos) ;

	if(gs->coins== coinsbefore+2)
	{
		printf("zzzstewardcardplay(): PASS when player chooses +2 coins\n");
	}
	else{

		printf("zzzstewardcardplay(): FAIL  when player chooses +2 coins\n");
	}

	
	
	//Test 3: Player chooses  to trash two cards
	gs=newGame();

	setUpGame(gs);

	 choice1=0;
	 choice2=1;
	 choice3=0;
	gs->handCount[player]=5;
	
		
	zzzstewardcardplay(player, choice1, choice2, choice3, gs, handpos) ;

	if(gs->handCount[player]==2)
	{
		printf("zzzstewardcardplay(): PASS when player chooses to trash two cards\n");
	}
	else{

		printf("zzzstewardcardplay(): FAIL  when player chooses to trash two cards\n");
	}
}


int main(int argc, char *argv[])
{
	testcardIsSteward();
    return 0;
}



